const Controller = require('../../core/controller/ApiController');
const {Route, HttpGet,HttpPost, Middleware, filters} = require('../../../plugin/egg-decorator-router/lib');
const {ExceptionHandler} = require('../../../plugin/egg-controller-exception-handler/lib');


@Route('/api/admin/info')

class AnsCtrl extends Controller{

    @HttpPost('/insert')
    @ExceptionHandler()
    async insertInfo() {
        const rule = {
            class:'string',
            name:'string',
            ans1:'string',
            ans2:'string',
            ans3:'string',
            ans4:'string',
            ans5:'string',
            ans6:'string',
            start_time:'string',
            end_time:'string',

        }
        this.validate(rule,this.ctx.request.body);
        this.result.data = await this.service.admin.info.main.insertInfo(this.ctx.request.body);
        return '添加成功'
    }


}
module.exports = AnsCtrl;
